<!DOCTYPE html>

<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">

<title>class PersonController - Rails Application Documentation</title>

<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
</script>

<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>


<body id="top" class="class">
<nav id="metadata">
  <nav id="home-section" class="section">
  <h3 class="section-header">
    <a href="./index.html">Home</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </h3>
</nav>


  <nav id="search-section" class="section project-section" class="initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <h3 class="section-header">
      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">
    </h3>
  </form>

  <ul id="search-results" class="initially-hidden"></ul>
</nav>


  <div id="file-metadata">
    <nav id="file-list-section" class="section">
  <h3 class="section-header">Defined In</h3>
  <ul>
    <li>app/controllers/person_controller.rb
  </ul>
</nav>

    
  </div>

  <div id="class-metadata">
    
    <nav id="parent-class-section" class="section">
  <h3 class="section-header">Parent</h3>
  
  <p class="link"><a href="ApplicationController.html">ApplicationController</a>
  
</nav>

    
    <!-- Method Quickref -->
<nav id="method-list-section" class="section">
  <h3 class="section-header">Methods</h3>

  <ul class="link-list">
    
    <li><a href="#method-i-getFacet">#getFacet</a>
    
    <li><a href="#method-i-sru">#sru</a>
    
    <li><a href="#method-i-sru2solr">#sru2solr</a>
    
  </ul>
</nav>

  </div>

  <div id="project-metadata">
    <nav id="fileindex-section" class="section project-section">
  <h3 class="section-header">Pages</h3>

  <ul>
  
    <li class="file"><a href="./doc/README_FOR_APP.html">README_FOR_APP</a>
  
  </ul>
</nav>

    <nav id="classindex-section" class="section project-section">
  <h3 class="section-header">Class and Module Index</h3>

  <ul class="link-list">
  
    <li><a href="./MarcTools.html">MarcTools</a>
  
    <li><a href="./MarcTools/MarcConverter.html">MarcTools::MarcConverter</a>
  
    <li><a href="./ApplicationController.html">ApplicationController</a>
  
    <li><a href="./ApplicationHelper.html">ApplicationHelper</a>
  
    <li><a href="./CzController.html">CzController</a>
  
    <li><a href="./MarcconverterController.html">MarcconverterController</a>
  
    <li><a href="./Object.html">Object</a>
  
    <li><a href="./OracleController.html">OracleController</a>
  
    <li><a href="./PersonController.html">PersonController</a>
  
    <li><a href="./PersonHelper.html">PersonHelper</a>
  
    <li><a href="./RsqvHelper.html">RsqvHelper</a>
  
    <li><a href="./RsqvpreviewController.html">RsqvpreviewController</a>
  
  </ul>
</nav>

  </div>
</nav>

<div id="documentation">
  <h1 class="class">class PersonController</h1>

  <div id="description" class="description">
    
  </div><!-- description -->

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    

    

    <!-- Methods -->
    
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Public Instance Methods</h3>

    
      <div id="method-i-getFacet" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">getFacet</span><span
            class="method-args">(doc, dn, index)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Helper method to get ZEBRA-facet for the result set IMPORTANT: Zebra
facects are not relieable at the moment Parameters: XML-Document,
Namespace, Indexfield</p>
          

          
          <div class="method-source-code" id="getFacet-source">
            <pre><span class="ruby-comment"># File app/controllers/person_controller.rb, line 15</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">getFacet</span>(<span class="ruby-identifier">doc</span>, <span class="ruby-identifier">dn</span>, <span class="ruby-identifier">index</span>)
    <span class="ruby-identifier">facet_place</span>=<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'//fac:record/fac:facet[@index=&quot;'</span><span class="ruby-operator">+</span><span class="ruby-identifier">index</span><span class="ruby-operator">+</span><span class="ruby-string">'&quot;]/fac:term[@occur]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">to_a</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">4</span>]
        <span class="ruby-identifier">f_place</span>=[]
        <span class="ruby-identifier">facet_place</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">node</span><span class="ruby-operator">|</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">content</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">&gt;</span><span class="ruby-value">1</span>
            <span class="ruby-identifier">content</span>=<span class="ruby-identifier">node</span>.<span class="ruby-identifier">content</span>.<span class="ruby-identifier">capitalize</span>
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">content</span>=<span class="ruby-identifier">node</span>.<span class="ruby-identifier">content</span>
          <span class="ruby-keyword">end</span>
          <span class="ruby-identifier">f_place</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">content</span>, <span class="ruby-string">&quot;(&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">node</span>[<span class="ruby-string">'occur'</span>]<span class="ruby-operator">+</span><span class="ruby-string">&quot;)&quot;</span>]
        }
        <span class="ruby-identifier">f_place</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- getFacet-source -->
          
        </div>

        

        
      </div><!-- getFacet-method -->

    
      <div id="method-i-sru" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">sru</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Main method for retrieve data via SRU</p>
          

          
          <div class="method-source-code" id="sru-source">
            <pre><span class="ruby-comment"># File app/controllers/person_controller.rb, line 5</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">sru</span>
  <span class="ruby-ivar">@name</span>=<span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">require</span> <span class="ruby-string">'libxml'</span>  
  <span class="ruby-identifier">require</span> <span class="ruby-string">'libxslt'</span>
  <span class="ruby-identifier">dn</span> =<span class="ruby-string">'dn:http://www.loc.gov/MARC21/slim'</span>
  <span class="ruby-identifier">fac</span> =<span class="ruby-string">'fac:http://www.indexdata.com/zebra/'</span>
  
  <span class="ruby-comment">#Helper method to get ZEBRA-facet for the result set</span>
  <span class="ruby-comment">#IMPORTANT: Zebra facects are not relieable at the moment</span>
  <span class="ruby-comment">#Parameters: XML-Document, Namespace, Indexfield</span>
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">getFacet</span>(<span class="ruby-identifier">doc</span>, <span class="ruby-identifier">dn</span>, <span class="ruby-identifier">index</span>)
      <span class="ruby-identifier">facet_place</span>=<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'//fac:record/fac:facet[@index=&quot;'</span><span class="ruby-operator">+</span><span class="ruby-identifier">index</span><span class="ruby-operator">+</span><span class="ruby-string">'&quot;]/fac:term[@occur]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">to_a</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">4</span>]
          <span class="ruby-identifier">f_place</span>=[]
          <span class="ruby-identifier">facet_place</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">node</span><span class="ruby-operator">|</span>
            <span class="ruby-keyword">if</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">content</span>.<span class="ruby-identifier">size</span><span class="ruby-operator">&gt;</span><span class="ruby-value">1</span>
              <span class="ruby-identifier">content</span>=<span class="ruby-identifier">node</span>.<span class="ruby-identifier">content</span>.<span class="ruby-identifier">capitalize</span>
            <span class="ruby-keyword">else</span>
              <span class="ruby-identifier">content</span>=<span class="ruby-identifier">node</span>.<span class="ruby-identifier">content</span>
            <span class="ruby-keyword">end</span>
            <span class="ruby-identifier">f_place</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">content</span>, <span class="ruby-string">&quot;(&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">node</span>[<span class="ruby-string">'occur'</span>]<span class="ruby-operator">+</span><span class="ruby-string">&quot;)&quot;</span>]
          }
          <span class="ruby-identifier">f_place</span>
  <span class="ruby-keyword">end</span>
   
 <span class="ruby-comment">#Helper method to convert SRU-search parameter to SOLR-search parameter</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">sru2solr</span>(<span class="ruby-identifier">text</span>)
  <span class="ruby-identifier">res</span>=[]
  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">'='</span>)
    <span class="ruby-identifier">res</span><span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>).<span class="ruby-identifier">size</span><span class="ruby-operator">==</span><span class="ruby-value">2</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-string">'*'</span>)
    <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-string">':'</span><span class="ruby-operator">+</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span>]
<span class="ruby-keyword">else</span>
<span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-string">':&quot;'</span><span class="ruby-operator">+</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span>]<span class="ruby-operator">+</span><span class="ruby-string">'&quot;'</span>
<span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">res</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-string">':'</span>
    <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot; and &quot;</span>)
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'and'</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-string">'*'</span>)
        <span class="ruby-identifier">res</span> <span class="ruby-string">&quot;      else
        res &lt;&lt;'&quot;'+ v.split('and')[0].strip+'&quot;'
end
        res &lt;&lt; &quot;AND&quot;
        res&lt;&lt;v.split('and')[1]+':'
      else
        if v.include?('*')
          res &lt;&lt; v
        else
          res &lt;&lt; '&quot;'+v+'&quot;'
        end
      end
    }
  end
  res.join(' ').gsub(' and ',' AND ')
end
     
def getSolrFacet(doc, index)
    facet_place=doc.find('//lst/lst/lst[@name=&quot;'+index+'&quot;]/child::node()').to_a
        f_place=[]
        facet_place.each {|node|
          node.each {|e|
            if node.content.to_i&gt;0
              if node[&quot;name&quot;].size&gt;1
                            content=node[&quot;name&quot;].capitalize
              else
                content=node[&quot;name&quot;]
              end
          f_place &lt;&lt; [content,&quot;(&quot;+String(node.content)+&quot;)&quot;]
          end 
          }
        }
        f_place
end
        
  
  @para=params
  if params[&quot;sru&quot;]
  @par=params
  @name=params[&quot;sru&quot;][&quot;name&quot;] if params[&quot;sru&quot;][&quot;name&quot;]
    #@solr_name=[]
    #@name.split(&quot;=&quot;).join(&quot;:&quot;).split(&quot; &quot;).each {|s|
      #if s.include?(&quot;:&quot;)
      #@solr_name &lt;&lt; s.split(&quot;:&quot;)[0]+&quot;:&quot;
      #@solr_name &lt;&lt;'&quot;'+s.split(&quot;:&quot;)[1]+'&quot;'
    
#else
  #@solr_name&lt;&lt;s
  #end
#}
    #@solr_name=String(@name).gsub(&quot;=&quot;,&quot;:&quot;).gsub(&quot; and &quot;, &quot; AND &quot;)
    
  end
  @start=params[&quot;start&quot;] if params[&quot;start&quot;]
  url='http://lab.rism.info:9910/person?operation=searchRetrieve&amp;version=1.1&amp;query='+String(@name)+'&amp;maximumRecords=20&amp;startRecord='+String(@start)+'&amp;sortKeys=author'
  xml_document =LibXML::XML::Document.file(url)
  
  #facet_url='http://lab.rism.info:9910/person?operation=searchRetrieve&amp;version=1.1&amp;query='+String(@name)+'&amp;maximumRecords=1&amp;recordSchema=zebra::facet::place:p,profession:p,gender:w'
#facet_document =LibXML::XML::Document.file(facet_url)
if params[&quot;sru&quot;]
  @solr_facet_url='http://lab.rism.info:8080/solr/person/select/?q='+sru2solr(@name)+'&amp;version=2.2&amp;start=0&amp;rows=0&amp;indent=on&amp;facet=true&amp;facet.field=place&amp;facet.field=country&amp;facet.field=profession&amp;facet.field=gender&amp;facet.limit=6'
  solr_facet_document =LibXML::XML::Document.file(@solr_facet_url)
#@solr_facet_place=solr_facet_document.find('//lst/lst/lst[@name=&quot;place_m&quot;]').to_a
  @facet_place=getSolrFacet(solr_facet_document,'place')
  @facet_profession=getSolrFacet(solr_facet_document,'profession')
  @facet_gender=getSolrFacet(solr_facet_document,'gender')
  @facet_country=getSolrFacet(solr_facet_document,'country')


end  

  #@facet=facet_document.find('//fac:record/fac:facet',fac).to_a
  


#@facet_place=getSolrFacet(solr_facet_document,'place_m')
#@facet_place=getFacet(facet_document,fac,'place')
#@facet_profession=getFacet(facet_document,fac,'profession')
#@facet_gender=getFacet(facet_document,fac,'gender')
  
  

  
  
  #@facet_place=facet_document.find('//fac:record/fac:facet[@index=&quot;place&quot;]/fac:term[@occur&gt;5]',fac).to_a
  #@facet_place=facet_document.find('//fac:record/fac:facet[@index=&quot;place&quot;]/fac:term[@occur&gt;5]',fac).to_a
  

  
  
  
  
  @count=xml_document.find('//zs:numberOfRecords/text()')[0]
  style='/home/stephan/workspace/RISMToolKit/app/assets/person.xsl'
  stylesheet_doc=LibXML::XML::Document.file(style)
  stylesheet=LibXSLT::XSLT::Stylesheet.new(stylesheet_doc)
  @res=stylesheet.apply(xml_document)  
  
end
end

def info
  @updated=&quot;Updated 2013-07-30&quot;
end
&quot;</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'and'</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">strip</span>
</pre>
          </div><!-- sru-source -->
          
        </div>

        

        
      </div><!-- sru-method -->

    
      <div id="method-i-sru2solr" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">sru2solr</span><span
            class="method-args">(text)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Helper method to convert SRU-search parameter to SOLR-search parameter</p>
          

          
          <div class="method-source-code" id="sru2solr-source">
            <pre><span class="ruby-comment"># File app/controllers/person_controller.rb, line 30</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">sru2solr</span>(<span class="ruby-identifier">text</span>)
  <span class="ruby-identifier">res</span>=[]
  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">'='</span>)
    <span class="ruby-identifier">res</span><span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>).<span class="ruby-identifier">size</span><span class="ruby-operator">==</span><span class="ruby-value">2</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-string">'*'</span>)
    <span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-string">':'</span><span class="ruby-operator">+</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span>]
<span class="ruby-keyword">else</span>
<span class="ruby-identifier">res</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-string">':&quot;'</span><span class="ruby-operator">+</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span>]<span class="ruby-operator">+</span><span class="ruby-string">'&quot;'</span>
<span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">res</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">0</span>]<span class="ruby-operator">+</span><span class="ruby-string">':'</span>
    <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>)[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-string">&quot; and &quot;</span>)
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'and'</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-string">'*'</span>)
        <span class="ruby-identifier">res</span> <span class="ruby-string">&quot;      else
        res &lt;&lt;'&quot;'+ v.split('and')[0].strip+'&quot;'
end
        res &lt;&lt; &quot;AND&quot;
        res&lt;&lt;v.split('and')[1]+':'
      else
        if v.include?('*')
          res &lt;&lt; v
        else
          res &lt;&lt; '&quot;'+v+'&quot;'
        end
      end
    }
  end
  res.join(' ').gsub(' and ',' AND ')
end
     
def getSolrFacet(doc, index)
    facet_place=doc.find('//lst/lst/lst[@name=&quot;'+index+'&quot;]/child::node()').to_a
        f_place=[]
        facet_place.each {|node|
          node.each {|e|
            if node.content.to_i&gt;0
              if node[&quot;name&quot;].size&gt;1
                            content=node[&quot;name&quot;].capitalize
              else
                content=node[&quot;name&quot;]
              end
          f_place &lt;&lt; [content,&quot;(&quot;+String(node.content)+&quot;)&quot;]
          end 
          }
        }
        f_place
end
        
  
  @para=params
  if params[&quot;sru&quot;]
  @par=params
  @name=params[&quot;sru&quot;][&quot;name&quot;] if params[&quot;sru&quot;][&quot;name&quot;]
    #@solr_name=[]
    #@name.split(&quot;=&quot;).join(&quot;:&quot;).split(&quot; &quot;).each {|s|
      #if s.include?(&quot;:&quot;)
      #@solr_name &lt;&lt; s.split(&quot;:&quot;)[0]+&quot;:&quot;
      #@solr_name &lt;&lt;'&quot;'+s.split(&quot;:&quot;)[1]+'&quot;'
    
#else
  #@solr_name&lt;&lt;s
  #end
#}
    #@solr_name=String(@name).gsub(&quot;=&quot;,&quot;:&quot;).gsub(&quot; and &quot;, &quot; AND &quot;)
    
  end
  @start=params[&quot;start&quot;] if params[&quot;start&quot;]
  url='http://lab.rism.info:9910/person?operation=searchRetrieve&amp;version=1.1&amp;query='+String(@name)+'&amp;maximumRecords=20&amp;startRecord='+String(@start)+'&amp;sortKeys=author'
  xml_document =LibXML::XML::Document.file(url)
  
  #facet_url='http://lab.rism.info:9910/person?operation=searchRetrieve&amp;version=1.1&amp;query='+String(@name)+'&amp;maximumRecords=1&amp;recordSchema=zebra::facet::place:p,profession:p,gender:w'
#facet_document =LibXML::XML::Document.file(facet_url)
if params[&quot;sru&quot;]
  @solr_facet_url='http://lab.rism.info:8080/solr/person/select/?q='+sru2solr(@name)+'&amp;version=2.2&amp;start=0&amp;rows=0&amp;indent=on&amp;facet=true&amp;facet.field=place&amp;facet.field=country&amp;facet.field=profession&amp;facet.field=gender&amp;facet.limit=6'
  solr_facet_document =LibXML::XML::Document.file(@solr_facet_url)
#@solr_facet_place=solr_facet_document.find('//lst/lst/lst[@name=&quot;place_m&quot;]').to_a
  @facet_place=getSolrFacet(solr_facet_document,'place')
  @facet_profession=getSolrFacet(solr_facet_document,'profession')
  @facet_gender=getSolrFacet(solr_facet_document,'gender')
  @facet_country=getSolrFacet(solr_facet_document,'country')


end  

  #@facet=facet_document.find('//fac:record/fac:facet',fac).to_a
  


#@facet_place=getSolrFacet(solr_facet_document,'place_m')
#@facet_place=getFacet(facet_document,fac,'place')
#@facet_profession=getFacet(facet_document,fac,'profession')
#@facet_gender=getFacet(facet_document,fac,'gender')
  
  

  
  
  #@facet_place=facet_document.find('//fac:record/fac:facet[@index=&quot;place&quot;]/fac:term[@occur&gt;5]',fac).to_a
  #@facet_place=facet_document.find('//fac:record/fac:facet[@index=&quot;place&quot;]/fac:term[@occur&gt;5]',fac).to_a
  

  
  
  
  
  @count=xml_document.find('//zs:numberOfRecords/text()')[0]
  style='/home/stephan/workspace/RISMToolKit/app/assets/person.xsl'
  stylesheet_doc=LibXML::XML::Document.file(style)
  stylesheet=LibXSLT::XSLT::Stylesheet.new(stylesheet_doc)
  @res=stylesheet.apply(xml_document)  
  
end
end

def info
  @updated=&quot;Updated 2013-07-30&quot;
end
&quot;</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'and'</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">strip</span>
</pre>
          </div><!-- sru2solr-source -->
          
        </div>

        

        
      </div><!-- sru2solr-method -->

    
    </section><!-- public-instance-method-details -->
  
  </section><!-- 5Buntitled-5D -->

</div><!-- documentation -->


<footer id="validator-badges">
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
  <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.2.
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>

